﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace zlsoft.BHExtend.Interface
{
   public  class FileStreamToText
    {
        /// <summary>
        /// 主要用于成都公司办公平台，读取报表文件中的文本
        /// </summary>
        /// <param name="bytes">报表附件文件流</param>
        /// <returns></returns>
        public string ReadBHFileStreamToText(byte[] bytes)
        {
            System.IO.Stream stream = new System.IO.MemoryStream(bytes);
            int fsLen = (int)stream.Length;
            byte[] heByte = new byte[fsLen];
            int i = stream.Read(heByte, 0, heByte.Length);
            string TextString = System.Text.Encoding.Default.GetString(heByte);
            return TextString;
        }
    }
}
